package ThreadPool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/**
 * @author wang'ji'cheng
 * @date 2025/7/16
 */
public class ThreadPoolDemo {
    public static void main(String[] args) {
        //创建线程池对象
        ExecutorService pool1 = Executors.newCachedThreadPool();
        //提交任务 submit()，参数是线程的实现类
        pool1.submit(new MyRunnable());
        pool1.submit(new MyRunnable());
        pool1.submit(new MyRunnable());
        pool1.submit(new MyRunnable());
        pool1.submit(new MyRunnable());

        Runnable task = () -> {
            for (int i = 0; i < 100; i++) {
                System.out.println(i);
            }
        };

        new Runnable(){

            @Override
            public void run() {

            }
        };

    }


}
